import { useContext } from 'react';
import { PostIdH5PageContext } from '@/contexts/mobile/PostId';
import useContentLayer from '@/hooks/useContentLayer';

export default function ContentPostIdH5Page({ content }: { content: string }) {
  const context = useContext(PostIdH5PageContext);
  const metadata = context.metadata!;

  useContentLayer({
    dep: content,
    metadata,
  });

  return (
    <div className="my-4">
      <div
        className="clearfix content-layer text-break"
        dangerouslySetInnerHTML={{ __html: content || '' }}
      ></div>
    </div>
  );
}
